
 /* 
 * 判断输入的图片链接ImgUrl是否合法
 */
	
function isurl(){
	var imgurl = document.getElementById("img").value;
	str =imgurl.match(/http:\/\/.+/); 
			if (str == null){
			alert('请输入有效的URL!');
			
			}else{
			
			
			}

}
/*新浪分享
 * title:标题   content:内容  sinaLink:页面链接	 ImgUrl:图片地址 
 */
 
function xinlshare(){
	var title1 = document.getElementById("title").value;
	
	var content = document.getElementById("content").value;
	
	

	var ImgUrl = document.getElementById("img").value;
	var tmp="null";
	var regex = /.*\:\/\/([^\/]*).*/;
         var match = ImgUrl.match(regex);
         if(typeof match != "undefined"&& null != match)
                 tmp = match[1];
    
    var http="http://";
    var sinaLink=http+tmp;
	
	 window.open('http://service.weibo.com/share/share.php?title='+title1+content+'&url='+sinaLink+'&pic='+ImgUrl); 

}
/*人人分享
 * title:标题   content: 内容  rrLink:页面链接   ImgUrl:图片地址
 */
 
function renshare(){
var title1 = document.getElementById("title").value;
	var content = document.getElementById("content").value;
	var ImgUrl = document.getElementById("img").value;
	var tmp="null";
	var regex = /.*\:\/\/([^\/]*).*/;
         var match = ImgUrl.match(regex);
         if(typeof match != "undefined"&& null != match)
                 tmp = match[1];
 
    var http="http://";
    var rrLink=http+tmp;
	  window.open('http://widget.renren.com/dialog/share?resourceUrl='+rrLink+'&pic='+ImgUrl+'&title='+title1+'&description='+content); 
}
/*QQ空间分享
 * title:标题  content:内容   qqLink:页面链接		 ImgUrl:图片地址		
 */
 
function tengxshare(){
	var title1 = document.getElementById("title").value;
	var content = document.getElementById("content").value;
	var ImgUrl = document.getElementById("img").value;
	var tmp="null";	
	var regex = /.*\:\/\/([^\/]*).*/;
         var match = ImgUrl.match(regex);
         if(typeof match != "undefined"&& null != match)
                 tmp = match[1];
    
    var http="http://";
    var qqLink=http+tmp;
	  window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+qqLink+'&pics='+ImgUrl+'&title='+title1+'&desc='+content+'&summary='+'&site=');
}